﻿@using RBS.Core.Extension
@model Webdiyer.WebControls.Mvc.PagedList<RBS.Core.Model.P_Advertis_Payment>
<!--列表-->
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="ltable">
    <tr>
        <th width="8%">选择</th>
        <th align="left">优惠券标题</th>
        <th align="left">面额/caip</th>
        <th align="center">有效期</th>
        <th align="center">发行数量</th>
        <th align="center">已领取数/已使用数</th> 
        <th align="left">状态</th>
        <th width="8%">操作</th>
    </tr>
    @if (null != ViewData.Model)
    {
        foreach (var item in ViewData.Model)
        {
        <tr>
            <td align="center">
                <input type="checkbox" id="chkId" value="@item.Id" class="checkall" style="vertical-align: middle;" />
                <input id="hidId" type="hidden" value="@item.Id"/>
            </td>
            <td align="left">
                  @Html.ActionLink(@item.Crowd, "GiftUserList", new { apid = item.Id, Action1 = @RBS.Common.RBSEnums.ActionEnum.Show }) 
            </td>
            <td align="left">
                @if (item.DeedType == 1)
                {
                    @Html.Raw("菜名：" + new RBS.Core.BLL.Hotel.H_Hotel_Cookbook().GetModelByCache(item.Denomination).Name + "");
                }
                else
                {
                    @Html.Raw("面值：" + @item.Denomination + "元");
                } 
            </td>
            <td align="center">
                @(string.Format("{0:yyyy-MM-dd}", item.ValidStartTime))至@(string.Format("{0:yyyy-MM-dd}", item.ValidEndTime))
            </td> 
            <td align="center">
                @Html.DisplayFor(modelItem => item.Quantity)
            </td>
            <td align="center">
                @Html.DisplayFor(modelItem => item.Gift)/@Html.DisplayFor(modelItem => item.Used)
            </td> 
            <td align="left">
                  @Html.HtmlDeedStatus(item.DeedStatus) 
            </td>
            <td align="center">
                  @Html.ActionLink("重设", "PaymentEdit", new { id = item.Id, type = @item.DeedType })
                  @{ 
                           switch (item.DeedStatus)
                           {
                               case 0: 
                    @Html.ActionLink("作废", "Obsolete", new { id = item.Id, deedType = item.DeedType })
                                   break;
                               case 2:
                    @Html.ActionLink("作废", "Obsolete", new { id = item.Id, deedType = item.DeedType })
                                   break;
                           } 
                }
            </td>
        </tr>
        }
    }
</table>
<!--/列表-->
